package team2.arsystem.GUI;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MembersMenuScreen extends ListActivity{

	String[] strList = {"Add a new friend", 
						"View friends",
						"Back to Main Menu",
						"Logout"	
						};
	
	String[] classList = {"AddMembers","ViewMembers","MenuScreen","Logout"};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setListAdapter(new ArrayAdapter<String>(MembersMenuScreen.this,R.layout.listview,strList));
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub
		super.onListItemClick(l, v, position, id);
		try
		{
		Class nextScreen = Class.forName("team2.arsystem.GUI."+classList[position]);
		Intent menuSelectedIntent = new Intent(MembersMenuScreen.this, nextScreen);
		startActivity(menuSelectedIntent);
		}
		catch(Exception e)
		{
			Log.e("Error",e.toString());
		}
		
		}
	
}
